package org.sfx.apps

import scala.reflect.runtime.universe._
import scala.reflect.runtime.{currentMirror => cm}
import javafx.collections._
import javafx.beans.value.ObservableBooleanValue
import javafx.beans.value.ObservableValue

class A
class B extends A
class C

object Test extends App {
  val a = typeOf[A]
  val b = typeOf[B]
  val ctor = typeOf[C].member(nme.CONSTRUCTOR).asMethodSymbol
  val c = typeOf[C].typeSymbol.asClassSymbol
  val mm = cm.reflectClass(c).reflectConstructor(ctor)
  println(mm())
  println(b <:< a)
  
  val stringMembers: Iterable[Symbol] = typeOf[String].members.collect { 
    case m if m.isMethod => m.asMethodSymbol 
  }
  
  stringMembers.foreach { it =>
    println(it)
  }
  
  println(typeOf[ObservableBooleanValue] <:< typeOf[ObservableValue[java.lang.String]])
}
